<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>若梦TV--找回密码</title>
	<link rel="icon" href="favicon.ico">
	<link rel="stylesheet" type="text/css" href="../../lib/css/animate.min.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/jquery.dialogbox.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/reset.css">
	<link rel="stylesheet" type="text/css" href="../../css/comm.css">
	<link rel="stylesheet" type="text/css" href="../../css/login.css">
	<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.min.js"></script>
	<script type="text/javascript" charset="UTF-8" src="../../lib/js/reg.js"></script>
	<script type="text/javascript" charset="UTF-8" src="../../lib/js/md5.js"></script>
</head>
<body>
	<div class="login-wrap">
		<div class="login-logo" onclick="location.href='../view/index.html';"></div>
		<div class="login-inner">
			<div class="login-line full-line">
				<div class="left"><img src="../../img/login_phone.png" alt=""></div>
				<input type="text" placeholder="手机号码" name="phone" autocomplete="off">
			</div>
			<div class="login-line no-border">
				<div class="line-left left">
					<div class="left"><img src="../../img/login_fw.png" alt=""></div>
					<input type="text" placeholder="图片验证码" name="imgVerifiCode" autocomplete="off">
				</div>
				<div class="line-right right imgVerifiCode"><img src="/user/checkCode" alt=""></div>
			</div>
			<div class="login-line no-border">
				<div class="line-left left">
					<div class="left"><img src="../../img/login_fw.png" alt=""></div>
					<input type="text" placeholder="手机验证码" name="verifiCode" autocomplete="off">
				</div>
				<div class="line-right right text-center send-code">获取验证码</div>
			</div>
			<div class="login-line full-line">
				<div class="left"><img src="../../img/login_fw.png" alt=""></div>
				<input type="text" placeholder="密码"  name="password" autocomplete="off">
			</div>
			<div class="login-line full-line">
				<div class="left"><img src="../../img/login_fw.png" alt=""></div>
				<input type="text" placeholder="确认密码" name="password1" autocomplete="off">
			</div>
			<div class="login-line no-border"><div class="login-btn text-center btn">重置密码</div></div>
			<div class="login-last"><div class="left"></div><div class="right">忘记密码？<a href="login.html">登录</a></div></div>
		</div>
	</div>
	
	<!-- 加载层 -->
	<div class="fakeloader"></div>
</body>

<script type="text/javascript" charset="UTF-8" src="../../lib/js/fakeloader.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../layui/lay/dest/layui.all.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/main.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.hDialog.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/send_code.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/login.js"></script>
<script type="text/javascript">

window.cansend = true;
//发送 验证码
$(document).on('click','.send-code',function(){
	var d = {
		mobile : $('input[name=phone]').val(),
		verifyCode : $('input[name=imgVerifiCode]').val(),
		update:'1'
	}
	if (d.mobile.length == 0) {
		return $.tooltip('手机号码不能为空')
	}else if(!checkPhone(d.mobile)){
		return $.tooltip('手机号码只能为11位且不为0开头的数字的组合')
	}
	if (d.verifyCode.length == 0) {
		return $.tooltip('图片验证码不能为空')
	}else if (!checkcode(d.verifyCode)) {
		return $.tooltip('图片验证码只能为4位数字的组合')
	}
	if (cansend) {
		ajax_sendCode(d,this,'/user/getSmsCode');
	}
})
$(document).on('click','.login-btn',function(){
	var info = {
		mobile : $('input[name=phone]').val(),
		smsCode : $('input[name=verifiCode]').val(),
		password : $('input[name=password]').val(),		
		password1 : $('input[name=password1]').val()
	}
	if (info.mobile.length == 0) {
		return $.tooltip('手机号码不能为空')
	}else if(!checkPhone(info.mobile)){
		return $.tooltip('手机号码只能为11位且不为0开头的数字的组合')
	}
	if (info.smsCode.length == 0) {
		return $.tooltip('验证码不能为空')
	}else if (!checkcode(info.smsCode)) {
		return $.tooltip('验证码只能为4位数字的组合')
	}
	if (info.password.length == 0 || info.password1.length == 0) {
		return $.tooltip('密码不能为空')
	}else if (!checkPw(info.password)) {
		return $.tooltip('密码长度为6-16位')
	}else if (info.password != info.password1) {
		return $.tooltip('两次输入的密码不相同')
	}
	info.password = $.md5(info.password);
	delete info.password1;
	ajax_fw (info);
})
</script>
</html>